// pages/project/allcourses/allcourses.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    circular: false,
    interval: 2000,
    duration: 500,
    previousMargin: 0,
    nextMargin: 0,
    exportIshow:false,
    flag: [0, 0, 0],
    startext: ['', '', '', ],
    starsBox: [1, 2, 3, 4, 5],
    flag1: [0, 0, 0],
    startext1: ['', '', '', ],
    starsBox1: [1, 2, 3, 4, 5],
    flag2: [0, 0, 0],
    startext2: ['', '', '', ],
    starsBox2: [1, 2, 3, 4, 5],
    starIshow:false,
    array1: ['专家名称','小赵老师', '小李老师', '小张老师'],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  },
  // 专家显示
  lookExport(){
      this.setData({exportIshow:true})
  },
  // 关闭
  lookCloset(){
    this.setData({exportIshow:false})
  },
  // 进入详情
  detaillink(){
    wx.navigateTo({
      url: '/pages/project/mycoursesdetail/mycoursesdetail',
    })
  },
  changePic: function (e) {
      var index = e.currentTarget.dataset.index;
      console.log(index,'-');
      var num = e.currentTarget.dataset.no;
      console.log(num);
      var a = 'flag[' + index + ']';
      console.log(a);
      var b = 'startext[' + index + ']';
      console.log(b);
      var that = this;
      if (num == 1) {
          that.setData({
              [a]: 1,
              [b]: '1星'
          });
      } else if (num == 2) {
          that.setData({
              [a]: 2,
              [b]: '2星'
          });
      } else if (num == 3) {
          that.setData({
              [a]: 3,
              [b]: '3星'
          });
      } else if (num == 4) {
          that.setData({
              [a]: 4,
              [b]: '4星'
          });
      } else if (num == 5) {
          that.setData({
              [a]: 5,
              [b]: '5星'
          });
      }
  },
  changePic1: function (e) {
      var index = e.currentTarget.dataset.index;
      console.log(index,'-');
      var num = e.currentTarget.dataset.no;
      console.log(num);
      var a = 'flag1[' + index + ']';
      console.log(a);
      var b = 'startext1[' + index + ']';
      console.log(b);
      var that = this;
      if (num == 1) {
          that.setData({
              [a]: 1,
              [b]: '1星'
          });
      } else if (num == 2) {
          that.setData({
              [a]: 2,
              [b]: '2星'
          });
      } else if (num == 3) {
          that.setData({
              [a]: 3,
              [b]: '3星'
          });
      } else if (num == 4) {
          that.setData({
              [a]: 4,
              [b]: '4星'
          });
      } else if (num == 5) {
          that.setData({
              [a]: 5,
              [b]: '5星'
          });
      }
  },
  changePic2: function (e) {
    var index = e.currentTarget.dataset.index;
    console.log(index,'-');
    var num = e.currentTarget.dataset.no;
    console.log(num);
    var a = 'flag2[' + index + ']';
    console.log(a);
    var b = 'startext2[' + index + ']';
    console.log(b);
    var that = this;
    if (num == 1) {
        that.setData({
            [a]: 1,
            [b]: '1星'
        });
    } else if (num == 2) {
        that.setData({
            [a]: 2,
            [b]: '2星'
        });
    } else if (num == 3) {
        that.setData({
            [a]: 3,
            [b]: '3星'
        });
    } else if (num == 4) {
        that.setData({
            [a]: 4,
            [b]: '4星'
        });
    } else if (num == 5) {
        that.setData({
            [a]: 5,
            [b]: '5星'
        });
    }
},
bindPickerChange1: function(e) {
  console.log('picker发送选择改变，携带值为', e.detail.value)
  this.setData({
    index: e.detail.value
  })
},
  starClick(){
    this.setData({starIshow:true})
  },
  starCancel(){
    this.setData({starIshow:false})
  }
})